{% extends 'temp.html' %}

{% block type %}
    <div class="container">
     <div class="panel panel-default panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title"><span class="glyphicon glyphicon-open" aria-hidden="true"></span>{{ title }}</h3>
          </div>
      <div class="panel-body">
                 {#     novalidate取消网页默认的提示           #}
         <form class="form-horizontal" method="post" enctype="multipart/form-data" novalidate style="margin: 10px 10px">
              {% csrf_token %}
             {% for item in form %}
             <div class="form-group">
                  <label>{{ item.label }}:</label>
                       {{ item }}

                    <span style="color:red;">{{ item.errors.0 }}</span>
              </div>
             {% endfor %}
             <p style="margin-left:-14px ">(只能上传jpg/png格式的图片)</p>
              <button type="submit" class="btn btn-primary" onclick="test();">提 交</button>
          </form>
      </div>
     </div>
    </div>
{% endblock %}

{% block js %}
<script>
   function test(){
       var i ='上传成功';
       alert(i);
      //刷新页面
       location.reload();
   }
</script>
{% endblock %}